//
//  BBDressCollecCell.m
//  BearSiX
//
//  Created by Tom on 16/3/28.
//  Copyright © 2016年 Tom. All rights reserved.
//

#import "BBDressCollecCell.h"
#define cell_size CGSizeMake((WINSIZEWIDTH-WINSIZEWIDTH/10)/2, WINSIZEWIDTH/1.36)
@implementation BBDressCollecCell
-(instancetype)initWithFrame:(CGRect)frame{

    self = [super initWithFrame:frame];
    if (self) {
        [self createUI];
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}
-(UIImageView *)dressImage{

    if (!_dressImage) {
        _dressImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, cell_size.width, cell_size.height)];
        _dressImage.backgroundColor = [UIColor bb_defaultColorV2];
        _dressImage.image = [UIImage imageNamed:@"testYYY.jpg"];
    }
    return _dressImage;
}

-(void)createUI{

    UIView *backView = [[UIView alloc]initWithFrame:CGRectMake(0, cell_size.height-WINSIZEWIDTH/15, cell_size.width, WINSIZEWIDTH/15)];
    backView.backgroundColor = [UIColor colorWithHexString:@"000000" alpha:0.5];
    
    self.dressType = [[UILabel alloc]initWithFrame:CGRectMake(WINSIZEWIDTH/80, 0, cell_size.width/1.5, backView.height)];
    self.dressType.text = @"拍照礼服套餐";
    self.dressType.textColor = [UIColor whiteColor];
    self.dressType.font = [UIFont systemFontOfSize:WINSIZEWIDTH/24];
    
    self.dressNum = [[UILabel alloc]initWithFrame:CGRectMake(cell_size.width-WINSIZEWIDTH/6-self.dressType.x, 0, WINSIZEWIDTH/6, backView.height)];
    self.dressNum.textAlignment = NSTextAlignmentRight;
    self.dressNum.textColor = [UIColor whiteColor];
    self.dressNum.font = self.dressType.font;
    self.dressNum.text = @"(2套)";
    
    [backView addSubview:self.dressType];
    [backView addSubview:self.dressNum];
    [self addSubview:self.dressImage];
    [self addSubview:backView];
}
@end
